import Vue from 'vue'
import Router from 'vue-router'
import Login from './views/Login.vue'
import NotFound from './views/404.vue'
import Home from './views/Home.vue'
import Main from './views/Main.vue'
import Menu from './views/permission/Menus'
import Roles from './views/permission/Roles'
import Admin from './views/permission/Admin'
import Users from './views/users/List.vue'
import Info from './views/system/Info'

Vue.use(Router)

let routes = [
    {
        path: '/login',
        component: Login,
        name: '',
        hidden: true
    },
    {
        path: '/404',
        component: NotFound,
        name: '',
        hidden: true
    },
    //{ path: '/main', component: Main },
    {
        path: '/',
        component: Home,
        name: '系统设置',
        iconCls: 'fa fa-tv',  //图标样式class
        children: [
            { path: '/main', component: Main, name: '主页' },
            { path: '/info', component: Info, name: '配置信息' },
        ]
    },
    {
        path: '/',
        component: Home,
        name: '权限管理',
        iconCls: 'fa fa-key',
        children: [
            { path: '/menus', component: Menu, name: '菜单管理' },
            { path: '/roles', component: Roles, name: '角色管理' },
            { path: '/admins', component: Admin, name: '管理员列表'}
        ]
    },
    {
        path: '/',
        component: Home,
        name: '用户管理',
        iconCls: 'fa fa-users',
        leaf: false,//只有一个节点
        children: [
            { path: '/users', component: Users, name: '用户列表' }
        ]
    },
    {
        path: '*',
        hidden: true,
        redirect: { path: '/404' }
    }
];

export default new Router({routes})
